<?php

namespace app\admin\model;

use think\Model;
use traits\model\SoftDelete;

class BannerItem extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;
    protected $dateFormat = 'Y/m/d';

    protected function getStatusAttr($value){
        $status = [0=>'未知状态',1=>'应用',2=>'禁用'];
        return $status[$value];
    }

    //获取当前banner图片属于的banner信息
    public function banner()
    {
        return $this->belongsTo('Banner');
    }
}
